<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "tb_contact".
 *
 * @property int $id
 * @property string $name 客户名称
 * @property string $number 客户编号
 * @property int $cCategory 客户类别
 * @property string $cCategoryName 分类名称
 * @property double $taxRate 税率
 * @property double $amount 期初应付款
 * @property double $periodMoney 期初预付款
 * @property double $difMoney 初期往来余额
 * @property string $beginDate 余额日期
 * @property string $remark 备注
 * @property string $linkMans 客户联系方式
 * @property int $type -10客户  10供应商
 * @property string $contact
 * @property int $cLevel 客户等级ID
 * @property string $cLevelName 客户等级
 * @property string $pinYin
 * @property int $disable 0启用   1禁用
 * @property int $isDelete 0正常 1删除
 * @property string $admin_id 创建人
 * @property string $created_at 创建时间
 * @property string $updated_at 更新时间
 */
class Contact extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'tb_contact';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['name'], 'required'],
            [['cCategory', 'type', 'cLevel', 'disable', 'isDelete', 'admin_id', 'created_at', 'updated_at'], 'integer'],
            [['taxRate', 'amount', 'periodMoney', 'difMoney'], 'number'],
            [['beginDate'], 'safe'],
            [['linkMans'], 'string'],
            [['name', 'number', 'cCategoryName', 'cLevelName', 'pinYin'], 'string', 'max' => 50],
            [['remark'], 'string', 'max' => 100],
            [['contact'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '客户名称',
            'number' => 'Number',
            'cCategory' => 'C Category',
            'cCategoryName' => 'C Category Name',
            'taxRate' => 'Tax Rate',
            'amount' => 'Amount',
            'periodMoney' => 'Period Money',
            'difMoney' => 'Dif Money',
            'beginDate' => 'Begin Date',
            'remark' => '备注',
            'linkMans' => 'Link Mans',
            'type' => 'Type',
            'contact' => 'Contact',
            'cLevel' => 'C Level',
            'cLevelName' => 'C Level Name',
            'pinYin' => 'Pin Yin',
            'disable' => 'Disable',
            'isDelete' => 'Is Delete',
            'admin_id' => 'Admin ID',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}
